package org.travel.api.travel.pojo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

@Entity
public class Flightsprice {
    private Integer id;
    private Integer cangId;
    private Double price;
    private Integer flights;

    @Id
    @Column(name = "id", nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "CangId", nullable = false)
    public Integer getCangId() {
        return cangId;
    }

    public void setCangId(Integer cangId) {
        this.cangId = cangId;
    }

    @Basic
    @Column(name = "price", nullable = false, precision = 0)
    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Basic
    @Column(name = "flights", nullable = false)
    public Integer getFlights() {
        return flights;
    }

    public void setFlights(Integer flights) {
        this.flights = flights;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Flightsprice that = (Flightsprice) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(cangId, that.cangId) &&
                Objects.equals(price, that.price) &&
                Objects.equals(flights, that.flights);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, cangId, price, flights);
    }
}
